/**
 * Created by lixin on 2019-09-17
 */
exports.request = (current, url, params) => {

    const {config, ctx} = current;

    const request_url = `${config.url}${url}`;

    console.log('-----------------start------------------');
    console.log('请求地址:', request_url);
    console.log('请求参数:', params);
    console.log('------------------end-------------------');

    return ctx.curl(request_url, {
        // 必须指定 method
        method: 'POST',
        // 自动解析 JSON response
        dataType: 'json',
        // 通过 contentType 告诉 HttpClient 以 JSON 格式发送
        contentType: 'json',
        // 10 秒超时
        timeout: 10000,

        data: params
    });
};


